<?php
class MNews extends spModel{
	public $table = 'news';
	public $pk = 'id';
		
	public function getAttributes(){
		return array(
			'title'		=>'标题',
			'contents'	=>'内容',
			);
	}

	//过滤不需要的字段
	public function getUnFilteAttributes(){
		return array(
			'title'=>'title',
			'contents'=>'contents',
			'date'=>'date',
			);
	}
	
	public function getAttributeFormsets(){
		return array(
			'title'=>array('type'=>'textField', 'htmlOptions'=>array()),
			'contents'=>array('type'=>'textArea', 'htmlOptions'=>array('rows'=>'10', 'style'=>'height:230px;width:470px')),
		);
	}
}

